#ifndef _THREAD_SPECIFICAL_H__
#define _THREAD_SPECIFICAL_H__
#include <windows.h>

static unsigned int __stdcall threadFunction(void *);

class Thread {
        friend unsigned int __stdcall threadFunction(void *);
public:
        Thread();
        virtual ~Thread();
        int start(void * = NULL);
        void * wait();
        void stop();
        void detach();
        static void sleep(unsigned int);

protected:
        virtual void * run(void *) = 0;

private:
        HANDLE threadHandle;
        bool started;
        bool detached;
        void * param;
        unsigned int threadID;
};

#endif
